﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:sys="clr-namespace:System;assembly=mscorlib" 
             xmlns:igMenu="clr-namespace:Infragistics.Silverlight.XamWebMenu;assembly=Infragistics.Silverlight.XamWebMenu.v9.1" 
             x:Class="PmuRegistry.Silverlight.App"
             >
    
    <Application.Resources>
    
        <ResourceDictionary>

            <sys:Double x:Key="XXSmallTextSize">7</sys:Double>
            <sys:Double x:Key="XSmallTextSize">8</sys:Double>
            <sys:Double x:Key="SmallerTextSize">9</sys:Double>
            <sys:Double x:Key="SmallTextSize">10</sys:Double>
            <sys:Double x:Key="LargeTextSize">11</sys:Double>
            <sys:Double x:Key="LargerTextSize">13</sys:Double>
            <sys:Double x:Key="XLargeTextSize">30</sys:Double>
            <sys:Double x:Key="XXLargeTextSize">34</sys:Double>

            <sys:Double x:Key="BlankItemSize">10</sys:Double>
            <sys:Double x:Key="XXXSmallItemSize">25</sys:Double>
            <sys:Double x:Key="XXSmallItemSize">50</sys:Double>
            <sys:Double x:Key="XSmallItemSize">75</sys:Double>
            <sys:Double x:Key="SmallerItemSize">100</sys:Double>
            <sys:Double x:Key="SmallItemSize">125</sys:Double>
            <sys:Double x:Key="LargeItemSize">150</sys:Double>
            <sys:Double x:Key="LargerItemSize">200</sys:Double>
            <sys:Double x:Key="XLargeItemSize">250</sys:Double>
            <sys:Double x:Key="XXLargeItemSize">300</sys:Double>
            <sys:Double x:Key="XXXLargeItemSize">400</sys:Double>

            <sys:Double x:Key="LayoutColumnWidth">600</sys:Double>
            <sys:Double x:Key="MarginWidth">5</sys:Double>
            <sys:Double x:Key="SmallMarginWidth">2</sys:Double>
            <sys:Double x:Key="ApplicationMinHeight">600</sys:Double>
            <sys:Double x:Key="ApplicationMinWidth">800</sys:Double>
            <sys:Double x:Key="ApplicationStartupHeight">750</sys:Double>
            <sys:Double x:Key="ApplicationStartupWidth">900</sys:Double>

            <Storyboard x:Key="ButtonPressAnimation">
                <DoubleAnimation Storyboard.TargetProperty="ScaleX" 
                    From="1.0" To="0.9" Duration="0:0:0.1" AutoReverse="True" />
                <DoubleAnimation Storyboard.TargetProperty="ScaleY" 
                    From="1.0" To="0.9" Duration="0:0:0.1" AutoReverse="True" />
            </Storyboard>
            
            <ControlTemplate x:Key="SmallImageButtonTemplate" TargetType="Button">
                <Image Source="{TemplateBinding Content}" Width="16" Height="16" />
            </ControlTemplate>

            <ControlTemplate x:Key="ImageButtonTemplate" TargetType="Button">
                <StackPanel Orientation="Horizontal">
                    <Image Source="{TemplateBinding Content}" Width="16" Height="16" Margin="2" />
                    <TextBlock Text="{TemplateBinding Tag}" FontWeight="Bold" FontSize="{StaticResource LargeTextSize}" />                    
                </StackPanel>
            </ControlTemplate>
            
            <ControlTemplate x:Key="GrayPushPinButtonTemplate" TargetType="Button">
                <Grid>
                    <Ellipse Width="20" Height="20" Fill="{StaticResource GrayRadialGradientBrush}"/>
                    <TextBlock Text="{TemplateBinding Content}" FontSize="{StaticResource XXSmallTextSize}" Foreground="White" FontWeight="Bold" 
                               HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource TextBlockDarkBorderEffect}"/>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="RedPushPinButtonTemplate" TargetType="Button">
                <Grid>
                    <Ellipse Width="20" Height="20" Fill="{StaticResource RedRadialGradientBrush}"/>
                    <TextBlock Text="{TemplateBinding Content}" FontSize="{StaticResource XXSmallTextSize}" Foreground="White" FontWeight="Bold" 
                               HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource TextBlockDarkBorderEffect}"/>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="GreenPushPinButtonTemplate" TargetType="Button">
                <Grid>
                    <Ellipse Width="20" Height="20" Fill="{StaticResource GreenRadialGradientBrush}"/>
                    <TextBlock Text="{TemplateBinding Content}" FontSize="{StaticResource XXSmallTextSize}" Foreground="White" FontWeight="Bold" 
                               HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource TextBlockDarkBorderEffect}"/>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="YellowPushPinButtonTemplate" TargetType="Button">
                <Grid>
                    <Ellipse Width="20" Height="20" Fill="{StaticResource YellowRadialGradientBrush}"/>
                    <TextBlock Text="{TemplateBinding Content}" FontSize="{StaticResource XXSmallTextSize}" Foreground="White" FontWeight="Bold" 
                               HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource TextBlockDarkBorderEffect}"/>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="WhitePushPinButtonTemplate" TargetType="Button">
                <Grid>
                    <Ellipse Width="20" Height="20" Fill="{StaticResource WhiteRadialGradientBrush}"/>
                    <TextBlock Text="{TemplateBinding Content}" FontSize="{StaticResource XXSmallTextSize}" Foreground="White" FontWeight="Bold" 
                               HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource TextBlockDarkBorderEffect}"/>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="BluePushPinButtonTemplate" TargetType="Button">
                <Grid>
                    <Ellipse Width="20" Height="20" Fill="{StaticResource BlueRadialGradientBrush}"/>
                    <TextBlock Text="{TemplateBinding Content}" FontSize="{StaticResource XXSmallTextSize}" Foreground="White" FontWeight="Bold" 
                               HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource TextBlockDarkBorderEffect}"/>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="MapToolTipTemplate" TargetType="ToolTip">
                <Border Style="{StaticResource PortletBorderStyle}">
                    <StackPanel Orientation="Vertical">
                        <TextBlock HorizontalAlignment="Center" Text="{Binding Path=Name}" Style="{StaticResource LargeWhiteTextStyle}" Padding="1"/>
                        <Border BorderThickness="0" Background="{StaticResource PortletBackgroundBrush}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="21"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="80"/>
                                    <ColumnDefinition Width="220"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="Company:" Width="80" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="0" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=CompanyName}" Width="220" Padding="2" Grid.Row="0" Grid.Column="1"/>
                                <TextBlock Text="Protocol:" Width="80" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="1" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=ProtocolName}" Width="220" Padding="2" Grid.Row="1" Grid.Column="1"/>
                                <TextBlock Text="Device:" Width="80" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="2" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=DeviceName}" Width="220" Padding="2" Grid.Row="2" Grid.Column="1"/>
                                <TextBlock Text="Longitude:" Width="80" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="3" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=Longitude}" Width="220" Padding="2" Grid.Row="3" Grid.Column="1"/>
                                <TextBlock Text="Latitude:" Width="80" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="4" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=Latitude}" Width="220" Padding="2" Grid.Row="4" Grid.Column="1"/>
                            </Grid>
                        </Border>
                    </StackPanel>
                </Border>
            </ControlTemplate>

            <ControlTemplate x:Key="PdcInfoToolTipTemplate" TargetType="ToolTip">
                <Border Style="{StaticResource PortletBorderStyle}">
                    <StackPanel Orientation="Vertical">
                        <TextBlock HorizontalAlignment="Center" Text="{Binding Path=Acronym}" Style="{StaticResource LargeWhiteTextStyle}" Padding="1"/>
                        <Border BorderThickness="0" Background="{StaticResource PortletBackgroundBrush}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="21"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="100"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="Name:" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="0" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=Name}" Padding="2" Grid.Row="0" Grid.Column="1"/>
                                <TextBlock Text="Company:" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="1" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=CompanyName}" Padding="2" Grid.Row="1" Grid.Column="1"/>
                                <TextBlock Text="Protocol:" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="2" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=ProtocolName}" Padding="2" Grid.Row="2" Grid.Column="1"/>
                                <TextBlock Text="Vendor Device:" TextAlignment="Right" Padding="2" FontWeight="Bold" Grid.Row="3" Grid.Column="0"/>
                                <TextBlock Text="{Binding Path=VendorDeviceName}" Padding="2" Grid.Row="3" Grid.Column="1"/>                                
                            </Grid>
                        </Border>
                    </StackPanel>
                </Border>
            </ControlTemplate>

            <SolidColorBrush x:Key="LightColorBrush" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="DarkColorBrush" Color="#FF07426F"/>
            <LinearGradientBrush x:Key="ApplicationBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF032236" Offset="0"/>
                <GradientStop Color="#FF095188" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="HeaderBackgroundBrush" EndPoint="1,0" StartPoint="0,1">
                <GradientStop Color="#FF032236" Offset="0"/>
                <GradientStop Color="#FF095188" Offset="0.20"/>
                <GradientStop Color="#FF032236" Offset="0.35"/>
                <GradientStop Color="#FF095188" Offset="0.50"/>
                <GradientStop Color="#FF032236" Offset="0.65"/>
                <GradientStop Color="#FF095188" Offset="0.80"/>
                <GradientStop Color="#FF032236" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="MainTitleForegroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFFFFFF" Offset="0.4"/>
                <GradientStop Color="#FF3FA6FF" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="MainBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF095188"/>
                <GradientStop Color="#FFFFFFFF" Offset="0.5"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="ContentBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF073E69"/>
                <GradientStop Color="#FFDEE7EE" Offset="0.25"/>
                <GradientStop Color="#FFDEE7EE" Offset="0.75"/>
            </LinearGradientBrush>
            <RadialGradientBrush x:Key="PortletBackgroundBrush">
                <GradientStop Color="#FFFFFFFF"/>
                <GradientStop Color="#FF07426F" Offset="5"/>
            </RadialGradientBrush>
            <LinearGradientBrush x:Key="HeaderRowBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFB3C8D6" Offset="0"/>
                <GradientStop Color="#FFE1E9EE" Offset="1"/>
            </LinearGradientBrush>
            <LinearGradientBrush x:Key="PageBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF032236" Offset="0"/>
                <GradientStop Color="#FF095188" Offset="1"/>
            </LinearGradientBrush>
            <RadialGradientBrush x:Key="RedRadialGradientBrush" GradientOrigin=".2,.2">
                <GradientStop Offset="0.2" Color="#FFFF9999"/>
                <GradientStop Offset="0.5" Color="#FFFC0808"/>
            </RadialGradientBrush>
            <RadialGradientBrush x:Key="GreenRadialGradientBrush" GradientOrigin=".2,.2">
                <GradientStop Offset="0.2" Color="#FFB3FF46"/>
                <GradientStop Offset="0.5" Color="#FF2EB30D"/>
            </RadialGradientBrush>
            <RadialGradientBrush x:Key="YellowRadialGradientBrush" GradientOrigin=".2,.2">
                <GradientStop Offset="0.2" Color="#FFFFFFFF"/>
                <GradientStop Offset="0.5" Color="#FFE8E831"/>
            </RadialGradientBrush>
            <RadialGradientBrush x:Key="GrayRadialGradientBrush" GradientOrigin=".2,.2">
                <GradientStop Offset="0.2" Color="#FFA6A6A6"/>
                <GradientStop Offset="0.5" Color="#FF767676"/>
            </RadialGradientBrush>
            <RadialGradientBrush x:Key="WhiteRadialGradientBrush" GradientOrigin=".2,.2">
                <GradientStop Offset="0.5" Color="#FFF0F0F0"/>
                <GradientStop Offset="0.2" Color="#FFD4D4D4"/>
            </RadialGradientBrush>
            <RadialGradientBrush x:Key="BlueRadialGradientBrush" GradientOrigin=".2,.2">
                <GradientStop Offset="0.5" Color="#FF2588D8"/>
                <GradientStop Offset="0.2" Color="#FF65AAE2"/>
            </RadialGradientBrush>
            
            <DropShadowEffect x:Key="TextBlockDarkShadowEffect" BlurRadius="2" Color="#FF000000" Direction="310" ShadowDepth="2"/>
            <DropShadowEffect x:Key="TextBlockDarkBorderEffect" BlurRadius="2" Color="#FF000000" Direction="0" ShadowDepth="0"/>
            <DropShadowEffect x:Key="TextBlockLightShadowEffect" BlurRadius="2" Color="#FFFFFFFF" Direction="310" ShadowDepth="2"/>

            <Style x:Key="MainTitleStyle" TargetType="TextBlock">
                <Setter Property="Foreground" Value="{StaticResource MainTitleForegroundBrush}"/>
                <Setter Property="Effect" Value="{StaticResource TextBlockDarkShadowEffect}"/>
                <Setter Property="FontSize" Value="{StaticResource XLargeTextSize}"/>
                <Setter Property="FontFamily" Value="Lucida Sans Unicode"/>
            </Style>
            <Style x:Key="SmallerWhiteTextStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource SmallerTextSize}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
            </Style>
            <Style x:Key="SmallerWhiteTextWithEffectStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource SmallerTextSize}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
                <Setter Property="Effect" Value="{StaticResource TextBlockDarkShadowEffect}"/>
            </Style>
            <Style x:Key="SmallWhiteTextStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource SmallTextSize}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
            </Style>
            <Style x:Key="SmallWhiteTextWithEffectStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource SmallTextSize}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
                <Setter Property="Effect" Value="{StaticResource TextBlockDarkShadowEffect}"/>
            </Style>
            <Style x:Key="LargeWhiteTextStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource LargerTextSize}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
            </Style>
            <Style x:Key="LargeWhiteTextWithEffectStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource LargerTextSize}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
                <Setter Property="Effect" Value="{StaticResource TextBlockDarkShadowEffect}"/>
            </Style>
            <Style x:Key="XamWebMenuStyle" TargetType="igMenu:XamWebMenu">
                <Setter Property="Background" Value="{x:Null}"/>
                <Setter Property="Foreground" Value="#FFFFFFFF"/>
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="ExpandOnHover" Value="True"/>
            </Style>
            <Style x:Key="ContentBorderStyle" TargetType="Border">
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="Background" Value="{StaticResource ContentBackgroundBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource DarkColorBrush}"/>
            </Style>
            <Style x:Key="MainBorderStyle" TargetType="Border">
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="Background" Value="{StaticResource MainBackgroundBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource LightColorBrush}"/>
            </Style>
            <Style x:Key="PortletBorderStyle" TargetType="Border">
                <Setter Property="BorderThickness" Value="2"/>
                <Setter Property="Background" Value="{StaticResource DarkColorBrush}"/>
                <Setter Property="BorderBrush" Value="{StaticResource DarkColorBrush}"/>
                <Setter Property="CornerRadius" Value="5"/>
            </Style>
            <Style x:Key="HeaderRowBorderStyle" TargetType="Border">
                <Setter Property="Background" Value="{StaticResource HeaderRowBackgroundBrush}"/>
                <Setter Property="BorderThickness" Value="0"/>
            </Style>
            <Style x:Key="HeaderRowTextStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="{StaticResource SmallTextSize}"/>
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="Padding" Value="2"/>
            </Style>
            <Style x:Key="HeaderRowCellBorderStyle" TargetType="Border">
                <Setter Property="BorderThickness" Value="0,0,1,0"/>
                <Setter Property="BorderBrush" Value="#FFDDDDDD"/>
            </Style>
            <Style x:Key="ContentRowCellBorderStyle" TargetType="Border">
                <Setter Property="BorderThickness" Value="0,0,1,1"/>
                <Setter Property="BorderBrush" Value="#FFDDDDDD"/>
            </Style>
            <Style x:Key="GenericLabelStyle" TargetType="TextBlock">
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="Margin" Value="5" />
            </Style>

            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/ResourceMenuItemStyle.xaml" ></ResourceDictionary>
                <ResourceDictionary Source="Resources/ResourcePieChartStyle.xaml"></ResourceDictionary>
                <ResourceDictionary Source="Resources/ResourceAccordianStyle.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
            
        </ResourceDictionary>
        
    </Application.Resources>
    
</Application>
